import service from '@/utils/request'

export const getUsers = () => {
  return service.get('/admin/users')
}

export const createUser = (data) => {
  return service.post('/admin/users', data)
}

export const updateUser = (data) => {
  return service.put(`/admin/users`, data)
}

export const deleteUser = (id) => {
  return service.delete(`/admin/users/${id}`)
}

export const deleteBatch = (ids) => {
  return service.delete('/admin/users/deleteBatch', {
    data: ids,
  })
}

export const IUploadAvatar = (data) => {
  return service.post('/user/avatar', data)
}

export const updateUserInfo = (data) => {
  return service.put(`/user/me`, data)
}

export const me = () => {
  return service.get('/user/me')
}
